
int is_upper(char c)
{
	return c >= 'A' && c <= 'Z';
}

int is_lower(char c)
{
	return c >= 'a' && c <= 'z';
}

int is_digital(char c)
{
	return c >= '0' && c <= '9';
}

char upper_to_lower(char c)
{
	if (!is_upper(c))
		return -1;
	return c + ('a' - 'A');
}

char lower_to_upper(char c)
{
	if (!is_lower(c))
		return -1;
	return c - ('a' - 'A');
}

int digitalchar_to_int(char c)
{
	if (!is_digital(c))
		return -1;
	return c - '0';
}

